//
//  QLMyOrderHomeVC.m
//  神约
//
//  Created by qlwl on 17/2/21.
//  Copyright © 2017年 qlwl. All rights reserved.
//

#import "QLMyOrderHomeVC.h"
#import "QLMyBookOrderVC.h"
#import "QLBookMeOrderVC.h"

@interface QLMyOrderHomeVC ()
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation QLMyOrderHomeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.tableView.tableFooterView = [UIView new];
}

#pragma mark TabDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 2;
    }else {
        return 10;
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLMyOrderHomeCell"];
        NSArray * array = @[@"我预定的服务",@"预定我的服务"];
        cell.textLabel.text = array[indexPath.row];
        return cell;
    }else{
        UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"QLMyBookHomeOrderCell"];
        return cell;
    }
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        return 44;
    }else {
        return 66;
    }
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        if (indexPath.row == 0) {
            QLMyBookOrderVC * myBookVC = [NSString instantiateViewControllerWithIdentifier:@"QLMyBookOrderVC" andSBName:@"Mine"];
            [self.navigationController pushViewController:myBookVC animated:YES];
            
        }else if (indexPath.row == 1){
            
            QLBookMeOrderVC * bookMeVC = [NSString instantiateViewControllerWithIdentifier:@"QLBookMeOrderVC" andSBName:@"Mine"];
            [self.navigationController pushViewController:bookMeVC animated:YES];
        }
    }
}

@end
